package primetest.dto;

import java.util.UUID;

public class MedicineDto {
	private String key;
	private String name;
	private String genericNumber;
	private String note;
	private float price;
	private int quantity;
	private int orderedQuantity;
	private int soldQuantity;
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getGenericNumber() {
		return genericNumber;
	}
	public void setGenericNumber(String genericNumber) {
		this.genericNumber = genericNumber;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public float getPrice() {
		return price;
	}
	public void setPrice(float price) {
		this.price = price;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public int getOrderedQuantity() {
		return orderedQuantity;
	}
	public void setOrderedQuantity(int orderedQuantity) {
		this.orderedQuantity = orderedQuantity;
	}
	public int getSoldQuantity() {
		return soldQuantity;
	}
	public void setSoldQuantity(int soldQuantity) {
		this.soldQuantity = soldQuantity;
	}
	public boolean isValid() {
		if (quantity <= 0) {
			return false;
		}
		return true;
	}
	public void setAll(MedicineDto backMedicine) {
		this.key = backMedicine.key;
		name = backMedicine.name;
		genericNumber = backMedicine.genericNumber;
		note = backMedicine.note;
		price = backMedicine.price;
		quantity = backMedicine.quantity;
		orderedQuantity = backMedicine.orderedQuantity;
		soldQuantity = backMedicine.soldQuantity;
	}

	public MedicineDto() {
		key = UUID.randomUUID().toString();
	}
}
